package com.example.searchbackend.controller;

import com.example.searchbackend.model.Article;
import com.example.searchbackend.service.IArticleService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/article")
public class ArticleController {

    @Resource
    private IArticleService articleService;

    @GetMapping("/list")
    public List<Article> getAllArticles() {
        return articleService.getAllArticles();
    }
}
